<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ taglib prefix="ta" tagdir="/WEB-INF/tags/tatags" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>消息管理页面</title>
    <%@ include file="/ta/inc.jsp" %>
</head>
<body class="no-scrollbar">
<ta:pageloading/>
<ta:panel key="查询条件" cols="3" id="params">
    <ta:selectInput id="senderSysId" key="发送系统名称" data="${syspath}" displayValue="systemname" hiddenValue="systemid"/>
    <ta:selectInput id="sendUserId" key="发送人员姓名" data="${users}" displayValue="username" hiddenValue="userid"/>
    <ta:text id="title" key="消息头"/>
    <ta:date id="startTime" key="开始时间" showSelectPanel="true" datetime="true"></ta:date>
    <ta:date id="endTime" key="结束时间" showSelectPanel="true" datetime="true"></ta:date>
    <ta:buttonLayout align="right">
        <ta:button key="查询" onClick="fnShowMessageTotal()" isok="true" cssStyle="width:74px"></ta:button>
    </ta:buttonLayout>
</ta:panel>
<ta:box fit="true" cssStyle="overflow-y:auto;">
    <ta:box height="300px">
        <ta:panel key="消息列表" fit="true">
            <ta:datagrid id="messageTotal" fit="true" forceFitColumns="true" onRowClick="fnShowMessageDetail" columnFilter="true">
                <ta:datagridItem id="title" key="消息头" align="center" dataAlign="center"/>
                <ta:datagridItem id="sendsystemname" key="发送方系统名称" align="center" dataAlign="center"/>
                <ta:datagridItem id="sendusername" key="发送方姓名" align="center" dataAlign="center"/>
                <ta:datagridItem id="msgdate" key="发送时间" align="center" dataAlign="center"/>
                <ta:datagridItemOperate showAll="true" id="showMessageDetail" name="操作">
                    <ta:datagridItemOperateMenu icon="" name="详细体信息" click="fnOpenMsgDetail"></ta:datagridItemOperateMenu>
                    <ta:datagridItemOperateMenu icon="" name="附件信息" click="fnOpenMsgFiles"></ta:datagridItemOperateMenu>
                </ta:datagridItemOperate>
                <ta:dataGridToolPaging url="messageMgController!showTotalMessages.do"></ta:dataGridToolPaging>
            </ta:datagrid>
        </ta:panel>
    </ta:box>
    <ta:box height="300px">
        <ta:panel key="消息明细" fit="true">
            <ta:datagrid id="messageDetail" fit="true" forceFitColumns="true" columnFilter="true">
                <ta:datagridItem id="userid" key="接受者id"/>
                <ta:datagridItem id="systemname" key="接受者系统名称"/>
                <ta:datagridItem id="sendertype" key="发送渠道" collection="SENDMODE"/>
                <ta:datagridItem id="senddate" key="发送时间" />
                <ta:datagridItem id="state" key="状态" collection="MSGSTATE"/>
                <ta:datagridItem id="read" key="是否已读" formatter="fnReadState"/>
                <ta:datagridItem id="showtype" key="显示类型"/>
                <ta:dataGridToolPaging url="messageMgController!showDetailMessages.do"></ta:dataGridToolPaging>
            </ta:datagrid>
        </ta:panel>
    </ta:box>
</ta:box>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $("body").taLayout();
    });
    //打开查询详细信息窗口
    function fnOpenMsgDetail(data) {
        Base.openWindow("msgContent", "消息体信息", "messageMgController!toShowMessageDetail.do", {"dto['messageid']": data.msgid}, "90%", "90%", null, null, true);
    }

    //打开消息附件息窗口
    function fnOpenMsgFiles(data) {
        Base.openWindow("msgFiles", "消息附件信息", "messageMgController!toShowFilesMessages.do", {"dto['messageid']": data.msgid}, "90%", "90%", null, null, true);
    }
    //显示总消息数据
    function fnShowMessageTotal() {
        Base.clearGridDirty("messageTotal");
        Base.submit("params,messageTotal", "messageMgController!showTotalMessages.do");
    }
    //显示详细信息
    function fnShowMessageDetail(e, data) {
        Base.clearGridDirty("messageDetail");
        Base.submit("messageDetail", "messageMgController!showDetailMessages.do", {"dto['messageid']": data.msgid});
    }

    //已读标识
    function fnReadState(row, cell, value, columnDef, dataContext){
        if(value==1){
            return "已读";
        }
        else{
            return "未读";
        }
    }
</script>
<%@ include file="/ta/incfooter.jsp" %>